<template>
	<view class="pages header-bg">
		<view class="cu-custom" :style="[{ height: CustomBar + 'px' }]">
			<view class="cu-bar fixed header-bg2" :style="{height: CustomBar+'px',paddingTop: StatusBar+'px'}">
				<view class="content " :style="[{top:StatusBar+'px'}]" style="width: 100%;">
					<!-- <view class="text-bold font-36">个人中心</view> -->
				</view>
			</view>
		</view>
		<view class="margin-lr-sm">
			<!-- 登录状态 -->
			<view v-if="isLogin" style="background-color: transparent;">
				<!-- #ifndef MP-WEIXIN -->
				<view class="margin-tb-15 padding-tb padding-lr-xs">
				<!-- #endif -->

					<!-- #ifdef MP-WEIXIN -->
					<view class="margin-tb-15  padding-left-xs" style="background-color: transparent;">
					<!-- #endif -->
						<!-- 头像昵称 -->
						<view class="flex align-stretch overHidden" @click="handleJump"
							style="background-color: transparent;" data-url="/pages/user/user/info/index">
							<view class="fu-block-126 margin-right-sm flex-shrink round">
								<image :src="userInfo.head_img?userInfo.head_img:'https://heart.jujiaxindongli.cn/newimage/logo.jpg'"
									mode="aspectFill" style="border-radius: 50%;border: 2rpx solid rgba(255,98,41,0.6);"
									class="fu-block-126"></image>
							</view>
							<view class="flex-sub flex flex1 align-center justify-between overHidden"
								style="min-width: 1px;">
								<!-- 用户昵称 -->
								<view class="flex flex-direction justify-around overHidden flex-sub">
									<view class="flex justify-between align-center">
										<view class="text-lg text-bold text-cut flex-sub">
											{{userInfo.user_nickname || userInfo.user_name || ''}}
										</view>
										<!-- <button class="cu-btn" open-type="contact">
										<image src="https://localelife.chunchuangkeji.cn/h5img/images/013.png" style="width: 100rpx;height: 100rpx;margin-left: 20rpx;"></image>
									</button> -->
									</view>
									<view class="flex align-center" style="margin-top: 10px;">
										<!-- <view class="text-sm flex-sub">ID：{{ invite_code }}</view> -->
										<view class="header-icon-view" v-if="school_name">{{school_name}}</view>
										<view class="header-icon-view" v-else>暂未绑定学校</view>
										<!-- <view class="text-xs margin-left-sm fu-copy-invite" @click.stop="copyingInvite_code">
								    {{i18n['复制']}}
								  </view> -->
										<!-- <view class="flex">
								  	<view class="qiandao flex align-center justify-center" @click="handleJump" data-url="/pages/user/signin/signin-page/index">
								  		<image src="https://localelife.chunchuangkeji.cn/h5img/images/012.png" class="icon margin-right-8"></image>
								  		<text class="font-28">签到</text>
								  	</view>
								  	<view class="qiandao flex align-center justify-center margin-left-16">优惠券</view>
								  </view> -->
									</view>
									<view class="flex align-center"style="margin-top: 20rpx;flex-wrap: wrap;">
										
									    <template v-if="students_name.length>0">
												<view class="header-icon-view" v-for="(item,index) in students_name" :key="index">{{item.name}}</view>
										</template>
										<template v-else>
											<view class="header-icon-view">
												暂无绑定学生
											</view>
										</template>
									</view>
								</view>
								<view class="flex-shrink">
									<view class="flex" @click.stop>
										<!-- <view class="qiandao flex align-center justify-center" @click="handleJump"
											data-url="/pages/user/signin/signin-page/index">
											<image src="https://localelife.chunchuangkeji.cn/h5img/images/012.png"
												class="icon margin-right-8"></image>
											<text class="font-28">签到</text>
										</view> -->
										<!-- #ifdef APP-PLUS || H5 -->
										<button class="cu-btn" @click="handleJump"
											data-url="/pages/service-message/service/service/index">
											<image src="@/static/images/kefu.png" style="width: 100rpx;height: 100rpx;margin-left: 20rpx;"></image>
										</button>
										<!-- #endif -->
										<!-- #ifdef MP-WEIXIN -->
										<button class="cu-btn" open-type="contact">
											<image src="@/static/images/kefu.png" style="width: 100rpx;height: 100rpx;margin-left: 20rpx;"></image>
										</button>
										<!-- #endif -->
									</view>
								</view>
							</view>
						</view>
					</view>
				</view>
				<!-- 未登录状态 -->
				<view v-else class="flex align-center padding-lr-xs padding-tb radius-24" @click="tologin">
					<view class="fu-block-126 round margin-right">
						<image class="fu-block-126 round" src="https://heart.jujiaxindongli.cn/newimage/logo.jpg" mode="aspectFill">
						</image>
					</view>
					<view class="text-black text-lg">点击登录/注册</view>
				</view>
			</view>
			<!-- <view class="flex justify-around margin-top-26">
			<view class="flex flex-direction align-center" @click="handleJump" data-url="/pages/wallet/my-wallet/index">
				<text class="text-bold font-40">{{userInfo.user_money ? Number(userInfo.user_money) : 0}}</text>
				<text class="text-666 font-24 text-bold margin-top-8">金币</text>
			</view>
			<view class="flex flex-direction align-center" @click="handleJump" data-url="/pages/integral/integralgoods/integral-goods-list/index">
				<text class="text-bold font-40">{{userInfo.score ? userInfo.score : 0}}</text>
				<text class="text-666 font-24 text-bold margin-top-8">积分</text>
			</view>
			<view class="flex flex-direction align-center" @tap="handleJump" data-url="/pages/user/user/my-favorites/index">
				<text class="text-bold font-40">{{userInfo.store_collection_count ? userInfo.store_collection_count : 0}}</text>
				<text class="text-666 font-24 text-bold margin-top-8">收藏</text>
			</view>
			<view class="flex flex-direction align-center" @click="handleJump" data-url="/pages/user/coupon/my-coupon/index">
				<text class="text-bold font-40">{{userInfo.coupon_count ? userInfo.coupon_count : 0}}</text>
				<text class="text-666 font-24 text-bold margin-top-8">券</text>
			</view>
		</view> -->
			<!-- <view class="flex padding-lr-32 justify-between">
				<view class="box1 flex align-center justify-center" @click="handleJump"
					data-url="/pages/user/invite/user-invite/index">
					<view class="left flex align-center justify-center">
						<image src="/static/t1.png" mode="" class="fu-block-40 margin-right-16"></image>
					</view>
					<view class="flex-sub padding-left-24">
						<text class="fu-fs32">邀请好友</text>
					</view>
				</view>
				<view class="box1 bg-2 flex align-center justify-center" @click="handleJump"
					data-url="/pages/user/coupon/my-coupon/index">
					<view class="left flex align-center justify-center">
						<image src="/static/t2.png" mode="" class="fu-block-40 margin-right-16"></image>
					</view>
					<view class="flex-sub padding-left-24">
						<text class="fu-fs32">优惠券</text>
					</view>
				</view>
			</view> -->

			<!-- 喵币 -->
			<!-- <view class="mewBox flex justify-between">
				<view>
					<view style="font-size: 32rpx;">喵币</view>
					<view style="color: #FF6C34;font-size: 40rpx;">{{mew_money || 0}}</view>
				</view>
				<view class="flex" style="align-items: flex-start;" @click="handleJump"
					data-url="/pages/wallet/mew-wallet/index">
					<text class="text-666 fu-fs24">详情</text>
					<image src="https://localelife.chunchuangkeji.cn/h5img/images/arrow-r-3.png"
						style="width: 12rpx;margin-left: 12rpx;margin-top: 4rpx;" mode="widthFix"></image>
				</view>
			</view> -->
			<!-- 展示金额 -->
			<view style="padding: 30rpx 30rpx 0 30rpx;">
				<view class="jine-view">
					<view class="jine-flex"  @click="handleJump" data-url="/pages/wallet/my-wallet/index2">
						<view class="jine-price">{{balanceInfo}}</view>
						<view class="jine-title-view">
							<view class="jine-title">学费余额</view>
							<u-icon name="arrow-right" color="#ffffff" size="14"></u-icon>
						</view>
					</view>
					<view class="jine-flex" @click="handleJump" data-url="/pages/wallet/my-wallet/index1">
						<view class="jine-price">{{total_commission}}</view>
						<view class="jine-title-view">
							<view class="jine-title">累计补贴金额</view>
							<u-icon name="arrow-right" color="#ffffff" size="14"></u-icon>
						</view>
					</view>
				</view>
			</view>

			<!-- 我的订单 -->
			<view class="bg-white radius-24 padding-top" style="margin: 30rpx;padding: 16rpx;">
				<block>
					<view class="title padding-lr-sm flex justify-between align-center">
						<view class="fu-fs28 text-bold text-333">我的订单</view>
						<view class="text-999 text-sm" @tap="handleJump"
							data-url="/pages/order/order-list/all-order/index">
							查看全部
							<text class="lg text-999 cuIcon-right"></text>
						</view>
					</view>
					<view class="flex padding-tb">

						<view class="item flex-sub text-center dingdan" @tap="handleJump"
							data-url="/pages/order/order-list/all-order/index?type=unship">
							<image class="fu-block-64" src="@/static/images/01.png" mode=""></image>
							<view class="text-sm text-333 margin-top-20 text-bold">待使用</view>
							<view class="jiaobiao" v-if="ordernum.deliver != 0">
								{{ordernum.deliver}}
							</view>
						</view>
						<!-- <view class="item flex-sub text-center dingdan" @tap="handleJump"
							data-url="/pages/user/user/my-favorites/index">
							<image class="fu-block-64" src="/static/003.png" mode=""></image>
							<view class="text-sm text-333 margin-top-20 text-bold">收藏</view>
							<view class="jiaobiao" v-if="userInfo.store_collection_count">
								{{userInfo.store_collection_count ? userInfo.store_collection_count : 0}}
							</view>
						</view> -->
						<view class="item flex-sub text-center dingdan" @tap="handleJump"
							data-url="/pages/order/order-list/all-order/index?type=finish">
							<image class="fu-block-64" src="@/static/images/02.png" mode=""></image>
							<view class="text-sm text-333 margin-top-20 text-bold">待评价</view>
							<view class="jiaobiao" v-if="ordernum.evaluate != 0">
								{{ordernum.evaluate}}
							</view>
						</view>
						<view class="item flex-sub text-center dingdan" @tap="handleJump"
							data-url="/pages/order/order-list/all-order/index?type=evaluate">
							<image class="fu-block-64" src="@/static/images/03.png" mode="aspectFill"></image>
							<view class="text-sm text-333 margin-top-20 text-bold">已完成</view>
							<!-- <view class="jiaobiao" v-if="ordernum.finish != 0">
							{{ordernum.finish}}
						</view> -->
						</view>
						<view class="item flex-sub text-center dingdan" @tap="handleJump"
							data-url="/pages/order/order-list/all-order/index?type=evaluate">
							<image class="fu-block-64" src="@/static/images/04.png" mode="aspectFill"></image>
							<view class="text-sm text-333 margin-top-20 text-bold">已退款</view>
							<!-- <view class="jiaobiao" v-if="ordernum.finish != 0">
							{{ordernum.finish}}
						</view> -->
						</view>
					</view>
				</block>
				<!-- <view class="flex align-center justify-between" style="padding: 32rpx;" @click="handleJump" data-url="/pages/distribution/distribution/promoters/index">
				<view class="flex align-center">
					<image src="/static/222.png" class="fu-block-44 margin-right-24"></image>
					<text class="font-32 text-bold text-333">我的团队</text>
				</view>
				<image src="https://localelife.chunchuangkeji.cn/h5img/images/arrow-r-3.png" style="width: 14rpx;height: 25rpx;"></image>
			</view> -->
				<!-- <view class="flex align-center justify-between" style="padding: 24rpx;" @click="handleJump">
					<view class="flex align-center" @tap="handleJump" data-url="/pages/wallet/my-wallet/index1">
						<image src="https://localelife.chunchuangkeji.cn/h5img/images/my_collect.png"
							class="fu-block-44 margin-right-24"></image>
						<text class="font-30 text-bold text-333">我的钱包</text>
					</view>
					<image src="https://localelife.chunchuangkeji.cn/h5img/images/arrow-r-3.png"
						style="width: 14rpx;height: 25rpx;"></image>
				</view> -->
				<view class="flex align-center justify-between" style="padding: 24rpx;" @click="handleJump">
					<view class="flex align-center" @tap="handleJump" data-url="/pages/user/user/my-favorites/index">
						<image src="@/static/images/05.png"
							class="fu-block-44 margin-right-24"></image>
						<text class="font-30 text-bold text-333">我的收藏</text>
					</view>
					<image src="https://localelife.chunchuangkeji.cn/h5img/images/arrow-r-3.png"
						style="width: 14rpx;height: 25rpx;"></image>
				</view>
				<view class="flex align-center justify-between" style="padding: 24rpx;" v-if='is_show != 1'
					@click="toRuzhu" data-type="SWITCH" data-url="pages/goods/shop/shop-agreement/index">
					<view class="flex align-center">
						<image src="@/static/images/06.png"
							class="fu-block-44 margin-right-24"></image>
						<text class="font-30 text-bold text-333">商家入驻</text>
					</view>
					<image src="https://localelife.chunchuangkeji.cn/h5img/images/arrow-r-3.png"
						style="width: 14rpx;height: 25rpx;"></image>
				</view>
				<view class="flex align-center justify-between" style="padding: 24rpx;" v-else @click="goShopCome">
					<view class="flex align-center">
						<image src="@/static/images/06.png"
							class="fu-block-44 margin-right-24"></image>
						<text class="font-30 text-bold text-333">{{shopStateTitle}}</text>
					</view>
					<image src="https://localelife.chunchuangkeji.cn/h5img/images/arrow-r-3.png"
						style="width: 14rpx;height: 25rpx;"></image>
				</view>
				<!-- <view class="flex align-center justify-between" style="padding: 24rpx;" @click="xuexiao">
					<view class="flex align-center">
						<image src="@/static/images/07.png"
							class="fu-block-44 margin-right-24"></image>
						<text class="font-30 text-bold text-333">学费明细</text>
					</view>
					<image src="https://localelife.chunchuangkeji.cn/h5img/images/arrow-r-3.png"
						style="width: 14rpx;height: 25rpx;"></image>
				</view> -->
				<!-- 0是客户 1是学校，学校有分校权限 -->
				<!-- <view class="flex align-center justify-between" style="padding: 24rpx;" @click="fenxiao"
					data-type="SWITCH" data-url="/pages/tab/group/parent-group">
					<view class="flex align-center">
						<image src="@/static/images/07.png"
							class="fu-block-44 margin-right-24"></image>
						<text class="font-30 text-bold text-333">分销钱包明细</text>
					</view>
					<image src="https://localelife.chunchuangkeji.cn/h5img/images/arrow-r-3.png"
						style="width: 14rpx;height: 25rpx;"></image>
				</view> -->
				<!-- <view class="flex align-center justify-between" style="padding: 24rpx;" @click="toFen"
					data-type="SWITCH" data-url="/pages/user/invite/user-invite/index">
					<view class="flex align-center">
						<image src="https://localelife.chunchuangkeji.cn/h5img/images/my_fenxiao.png"
							class="fu-block-44 margin-right-24"></image>
						<text class="font-30 text-bold text-333">邀请好友</text>
					</view>
					<image src="https://localelife.chunchuangkeji.cn/h5img/images/arrow-r-3.png"
						style="width: 14rpx;height: 25rpx;"></image>
				</view> -->

				<view class="flex align-center justify-between" style="padding: 24rpx;" @click="handleJump"
					data-url="/pages/service-message/message/message-type/index">
					<view class="flex align-center">
						<image src="@/static/images/08.png"
							class="fu-block-44 margin-right-24"></image>
						<text class="font-30 text-bold text-333">消息</text>
						<view class="tag margin-lr-xs" v-if="ordernum.msg_num">{{ordernum.msg_num}}</view>
					</view>
					<image src="https://localelife.chunchuangkeji.cn/h5img/images/arrow-r-3.png"
						style="width: 14rpx;height: 25rpx;"></image>
				</view>
				<!-- <view class="flex align-center justify-between" style="padding: 32rpx;" @click.stop="handleJump" data-url="/pages/service-message/service/service/index"> -->
				<view class="flex align-center justify-between" style="padding: 24rpx;" @click.stop="serviceShow">
					<view class="flex align-center">
						<image src="@/static/images/09.png"
							class="fu-block-44 margin-right-24"></image>
						<text class="font-30 text-bold text-333">联系我们</text>
					</view>
					<image src="https://localelife.chunchuangkeji.cn/h5img/images/arrow-r-3.png"
						style="width: 14rpx;height: 25rpx;"></image>
				</view>
				<view class="flex align-center justify-between" style="padding: 24rpx;" @click.stop="handleJump"
					data-url="/pages/index/setting/setting/index">
					<view class="flex align-center">
						<image src="@/static/images/10.png"
							class="fu-block-44 margin-right-24"></image>
						<text class="font-30 text-bold text-333">设置</text>
					</view>
					<image src="https://localelife.chunchuangkeji.cn/h5img/images/arrow-r-3.png"
						style="width: 14rpx;height: 25rpx;"></image>
				</view>
				<view class="flex align-center justify-between" style="padding: 24rpx;" @click.stop="handleJump"
					data-url="/pages/user/coupon/my-coupon/index">
					<view class="flex align-center">
						<image src="@/static/images/11.png"
							class="fu-block-44 margin-right-24"></image>
						<text class="font-30 text-bold text-333">优惠券</text>
					</view>
					<image src="https://localelife.chunchuangkeji.cn/h5img/images/arrow-r-3.png"
						style="width: 14rpx;height: 25rpx;"></image>
				</view>
			</view>
			<!-- 推荐商品 -->
			<!-- <fu-waterflow ref="waterflow" type="userCenter"></fu-waterflow> -->
			<!-- 客服信息 -->
			<fu-popup mode="center" v-model="servicePopUp">
				<view class="flex flex-direction align-center">
					<view class="service-box">
						<view class="service-head">
							<view></view>
							<view>联系客服</view>
							<image src="../../../../static/quit.png" mode="" class="quitStyle"
								@click="servicePopUp = false"></image>
						</view>
						<view class="service-content">
							<view class="service-item">
								<view>客服微信：{{serviceData.wechat_id || ''}}</view>
								<view class="copyBtn" @click="copyData(serviceData.wechat_id)">复制</view>
							</view>
							<view class="service-item">
								<view>客服电话：{{serviceData.wechat_phone1 || '13200000000'}}</view>
								<view class="copyBtn" @click="makePhone(serviceData.wechat_phone1)">拨打</view>
							</view>
							<view class="service-item" v-if="serviceData.wechat_phone2">
								<view>客服电话：{{serviceData.wechat_phone2}}</view>
								<view class="copyBtn" @click="makePhone(serviceData.wechat_phone2)">拨打</view>
							</view>
							<view style="text-align: center;">
								<view>{{serviceData.time || ''}}</view>
								<image :src="serviceData.wechat_img" mode="" class="codeImgStyle"></image>
							</view>
						</view>
					</view>
				</view>
			</fu-popup>
		</view>
</template>
<script>
	export default {
		data() {
			return {
				servicePopUp: false, //客服弹窗
				ordernum: {
					deliver: 1,
					evaluate: 0,
					finish: 0,
					msg_num: 0,
					no_pay: 0
				},
				shopStateTitle: '商家入驻', // {String} 店铺状态描述
				shopStat: 0, // {Number} 店铺状态码
				showShopNotify: false, // {Boolean} 是否显示店铺申请通知
				shopNotifyFont: '', // {String} 店铺通知文字
				is_hidden: '1',
				invite_code: '',
				messageNum: 0,
				share_money: 0,
				discounts_money: 0,
				dataContent: {},
				is_show: 0,
				serviceData: {}, //客服信息
				mew_money: 0, //喵币
				school_fee:0,
				user_money:0,
				school_name:'',
				students_name:[],
				commission:0,
				total_commission:0
			};
		},
		computed: {
			userInfo() {
				let info = this.$store.getters.userInfo ? this.$store.getters.userInfo : {}
				return info;
			},
			isLogin() {
				return this.$store.getters.isLogin;
			},
			isMember() {
				return this.$store.getters.isMember;
			},
			balanceInfo(){
				let balancePrice = (Number(this.school_fee)+Number(this.commission)).toFixed('2')
				return balancePrice || '0.00'
			}
		},
		onLoad(options) {
			if (options.invite_code) {
				uni.setStorageSync('COMMONINVITECODESYNC', options.invite_code);
			}
			// #ifdef APP-PLUS
			this.is_show = '1'
			this.getHiddenInterface()
			// #endif
			// if (!this.isLogin) {
			// 	this.$util.navigateToLogin();
			// }
		},
		onShow() {
			// #ifdef APP-PLUS
			this.getHiddenInterface()
			// #endif
			if (this.isLogin) {
				this.getInfo();
				this.getOrderNum();
				this.queryShopState();
				this.queryShopApplyDetail();
				this.getMessageNum()
				this.getMoney();
				this.getContent();
				this.userInfo = uni.getStorageSync("USER_INFO")
			} else {
				this.ordernum = {
					deliver: 0,
					evaluate: 0,
					finish: 0,
					msg_num: 0,
					no_pay: 0
				};
				this.dataContent = {
					trecommend: 0,
					recommend_count1: 0,
					recommend_count2: 0
				}
			}
			this.getBindStudent()
		},
		onPullDownRefresh() {
			this.$refs.waterflow && this.$refs.waterflow.refresh();
		},
		onReachBottom() {
			this.$refs.waterflow && this.$refs.waterflow.loadData();
		},
		onShareAppMessage() {
			return {
				path: `/pages/tab/my/my/index?invite_code=${this.userInfo && this.userInfo.invite_code || ''}`
			}
		},
		onShareTimeline() {
			return {
				path: `/pages/tab/my/my/index?invite_code=${this.userInfo && this.userInfo.invite_code || ''}`
			}
		},
		methods: {
			// 获取绑定学生列表
			getBindStudent(){
				this.$api.post(global.apiUrls.getBindStudent).then((res)=>{
					this.students_name = res.data.data
				})
			},
			xuexiao(){
				uni.navigateTo({
					url: "/pages/tab/group/students-group",
				})
			},
			fenxiao(){
				uni.navigateTo({
					url: "/pages/tab/group/parent-group",
					// url: "/pages/user/invite/user-invite/index"
				})
			},
			toFen() {
				uni.navigateTo({
					url: "/pages/user/invite/user-invite/index"
				})
			},
			toRuzhu() {
				uni.navigateTo({
					url: "/pages/goods/shop/shop-agreement/index"
				})
			},
			//拨打电话
			makePhone(num) {
				uni.makePhoneCall({
					phoneNumber: num
				});
			},
			/**
			 * @function
			 * @description 点击复制
			 */
			copyData(data) {
				uni.setClipboardData({
					data: data,
					success: () => {
						// 隐藏自带轻提示
						uni.hideToast()
						uni.showToast({
							icon: 'none',
							title: this.i18n['复制成功']
						});
					}
				});
			},
			serviceShow() {
				this.getBase()
				this.servicePopUp = true
			},
			getBase() {
				this.$api.post(global.apiUrls.getBase).then(res => {
					console.log('客服信息', res);
					if (res.data.code == 1) {
						this.serviceData = res.data.data
					}
				})
			},
			zwkt() {
				this.$message.info('暂未开通')
				return
			},
			// 上架隐藏
			getHiddenInterface() {
				this.$api.post(global.apiUrls.hiddenInterface, {
					code: 'is_show'
				}).then(res => {
					if (res.data.code == 1) {
						this.is_show = res.data.data
						if (res.data.data == 1) {
							uni.setTabBarItem({
								index: 1,
								visible: false
							})
						} else {
							uni.setTabBarItem({
								index: 1,
								visible: true
							})
						}
					}
				})
			},
			getContent() {
				this.$api.post(global.apiUrls.post5fe69d2d1acb9).then(res => {
						console.log('推广人统计', res);
						if (res.data.code == 1) {
							this.dataContent = res.data.data
						} else {
							this.$message.error(res.data.msg)
						}
					})
					.catch(err => {
						console.log(err);
					})
			},
			/**
			 * @function
			 * @description 获取用户余额
			 */
			getMoney() {
				let _this = this;
				_this.$api
					.get(global.apiUrls.getMyMoney, {})
					.then(res => {
						console.log(res, 'get_my_money');
						if (res.data.code == 1) {
							_this.mew_money = res.data.data.mew_money
							_this.share_money = res.data.data.share_money
							_this.discounts_money = res.data.data.discounts_money
							_this.school_fee = res.data.data.school_fee?res.data.data.school_fee:0.00
							_this.commission = res.data.data.commission
							_this.total_commission = res.data.data.total_commission
							// _this.user_money = res.data.data.user_money;
							// _this.withdraw_handling_fee = res.data.data.withdraw_handling_fee
						}
					})
					.catch(err => {
						console.log(err, 'get_my_money');
					});
			},
			/**
			 * @function
			 * @description 获取未读消息数量
			 */
			getMessageNum() {
				this.$api.post(global.apiUrls.postMessageNum).then(res => {
					if (res.data.code == 1) {
						this.messageNum = res.data.data.all;
						console.log(this.messageNum, 'oplkkjk')
					}
				});
			},
			/**
			 * @function
			 * @description 复制邀请码
			 */
			copyingInvite_code() {
				uni.setClipboardData({
					data: this.invite_code,
					success: () => {
						// 隐藏自带轻提示
						uni.hideToast()
						uni.showToast({
							icon: 'none',
							title: this.i18n['复制成功']
						});
					}
				});
			},
			/**
			 * @function 查询店铺申请状态
			 */

			queryShopApplyDetail() {
				this.$api.post(global.apiUrls.getUserApplyShop).then(res => {
					if (res.data.code == 1) {
						switch (Number(res.data.data)) {
							case 1:
								this.shopNotifyFont = '您的开店申请正在审核。。。';
								this.showShopNotify = true;
								break;
							case 3:
								this.shopNotifyFont = '您的开店申请被拒绝，点击查看详情';
								this.showShopNotify = true;
								break;
							default:
								this.showShopNotify = false;
						}
					}
				});
			},
			/**
			 * @event 去店铺申请详情
			 */
			goApplyDetail() {
				if (this.shopStat == 3) {
					this.$urouter.navigateTo('/pages/goods/shop/shop-success/index?notifyState=1');
				}
			},
			/**
			 * @function 查询店铺状态
			 */
			queryShopState() {
				this.$api
					.post(global.apiUrls.getUserApplyShopStatus)
					.then(res => {
						if (res.data.code == 1) {
							this.shopStat = Number(res.data.data.joinin_state);
							console.log(this.shopStat)

							switch (this.shopStat) {
								case 0:
									this.shopStateTitle = '商家入驻';
									break;
								case 1:
									this.shopStateTitle = '待认证审核';
									break;
								case 5:
									this.shopStateTitle = '我的店铺';
									break;
								case 3:
									this.shopStateTitle = '认证审核失败 ';
									break;
								case 4:
									this.shopStateTitle = '待财务审核 ';
									break;
								case 6:
									this.shopStateTitle = '财务审核失败 ';
									break;
								case 2:
									this.shopStateTitle = '待提交财务凭证 ';
									break;
							}
						}
					})
					.catch(err => {
						console.log('queryShopStateError', err);
					});
			},
			/**
			 * @event 去店铺认证页面
			 * @param {Number} res.data.data - 0:从未申请过；1:审核中；2:申请通过；3:申请被拒绝；
			 */
			goShopCome() {

				// this.$urouter.navigateTo('/pages/goods/shop/shop-agreement/index');
				const that = this;
				switch (this.shopStat) {
					case 0:
						this.$urouter.navigateTo('/pages/goods/shop/shop-agreement/index');
						break;
					case 5:

						// this.$message.info('请通过链接下载商家端app');
						this.$urouter.navigateTo('/pages/goods/shop/shop-success/index');
						break;
					default:
						this.$urouter.navigateTo('/pages/goods/shop/shop-success/index');
						break;
				}
			},
			navTo(path, auth) {
				if (!path) return this.$message.info('功能暂未开发');
				if (auth) {
					this.$util.actionAuth(() => {
						uni.navigateTo({
							url: path
						})
					})
				} else {
					uni.navigateTo({
						url: path
					})
				}
			},
			tologin() {
				this.$util.navigateToLogin();
			},
			// 获取订单数量
			getOrderNum() {
				this.$api.post(global.apiUrls.postOrderNum)
					.then(res => {
						if (res.data.code == 1) {
							this.ordernum = res.data.data;
							if (this.ordernum.msg_num > 99) {
								this.ordernum.msg_num = '99+'
							}
						}
					})
			},
			// 获取用户信息
			getInfo() {
				this.$api.post(global.apiUrls.postGetUserInfo).then(res => {
					if (res.data.code == 1) {
						this.school_name =  res.data.data.school_name
						this.invite_code = res.data.data.invite_code;
						this.$store.commit('updateUserInfo', res.data.data);
					}
				}).catch(err => {})
			},
		}
	};
</script>
<style lang="scss" scoped>
	.header-icon-view{
		padding: 10rpx 20rpx;
		background-color: #FCF3F4;
		border-radius: 10rpx;
		font-size: 12px;
		color: #D386A5;
		margin: 0 10rpx 10rpx 0;
		flex-shrink: 0;
	}
	page {
		background-color: #F6F7F9;
		padding-bottom: 20rpx;
	}
	.jine-title{
		font-size: 15px;
		margin-right: 10rpx;
		color: #ffffff;
	}
	.jine-title-view{
		display: flex;
		align-items: center;
	}
	.jine-price{
		font-size: 23px;
		color: #ffffff;
		margin-bottom: 20rpx;
	}
	.jine-flex{
		flex: 1;
		display: flex;
		align-items: center;
		justify-content: center;
		flex-direction: column;
	}
	
	.jine-view{
		width: 100%;
		height: 200rpx;
		padding: 20rpx;
		border-radius: 20rpx;
		background: linear-gradient(#FD51A0, #FB9777);
		display: flex;
		align-items: center;
	}

	.pages {
		padding-bottom: 100rpx;
	}

	.service-box {
		width: 600rpx;
		height: 800rpx;
		padding: 32rpx;
		border-radius: 38rpx;
		background: linear-gradient(#fef0ed, #ffffff);

		.service-head {
			color: #333;
			font-size: 32rpx;
			font-weight: 600;
			padding-bottom: 32rpx;
			display: flex;
			align-items: center;
			justify-content: space-between;
			border-bottom: 1rpx solid #eee;
		}

		.quitStyle {
			width: 35rpx;
			height: 35rpx;
		}

		.service-content {
			padding: 24rpx 0;
			font-size: 28rpx;

			.service-item {
				display: flex;
				justify-content: space-between;
				padding: 12rpx 24rpx;
			}
		}

		.copyBtn {
			color: #FD9CAE;
			padding: 0 12rpx;
			border-radius: 8rpx;
			border: 1rpx solid #FD9CAE;
		}

		.codeImgStyle {
			width: 360rpx;
			height: 360rpx;
		}
	}

	.header-bg {
		// background-image: url($IMG_BASE_URL + 'my_bg.png');
		// background-repeat: no-repeat;
		// background-size: 100% 50%;
		// background: linear-gradient(to bottom, #FAEBEE, #ffffff);
		width: 100%;
		min-height: 100vh;
		background: url('https://localelife.chunchuangkeji.cn/static/home_bg.jpg') no-repeat;
		background-size:100% 100%;
	}

	.header-bg2 {
		// background-image: url($IMG_BASE_URL + 'my_bg.png');
		// background-repeat: no-repeat;
		// background-size: 100%;
		// background: linear-gradient(to bottom, #FAEBEE, #ffffff);
	}

	.dingdan {
		position: relative;

		.jiaobiao {
			position: absolute;
			top: 0;
			right: 48rpx;
			width: 30rpx;
			height: 30rpx;
			color: #FFFFFF;
			background: #FD9CAE;
			border-radius: 50%;
			font-size: 20rpx;
			text-align: center;
			line-height: 30rpx;
		}
	}

	.cu-list.menu>.cu-item .content {
		display: flex;
		align-items: center;
	}

	.member-box {
		background-image: url($IMG_BASE_URL + 'tab/bg.png');
		background-size: cover;

		.exchange-btn {
			background: #874F02;
		}
	}

	.progressBar {
		margin: 24rpx 0 16rpx;

		.box {
			height: 13rpx;
			background: rgba(236, 237, 242, 0.3);
			border-radius: 13rpx;

			view {
				height: 13rpx;
				border-radius: 13rpx;
				background: #fff;
			}
		}
	}

	.my-wallet {
		position: relative;
		border-left: 1px solid #EEEEEE;

		&:after {
			content: "";
			width: 0;
			height: 0;
			position: absolute;
			top: 50%;
			transform: translateY(-50%);
			left: 0;
			border-top: solid 10rpx transparent;
			border-left: solid 10rpx #eee;
			border-bottom: solid 10rpx transparent;
		}

		&:before {
			content: "";
			width: 0;
			height: 0;
			position: absolute;
			top: 50%;
			transform: translateY(-50%);
			left: -2rpx;
			border-top: solid 10rpx transparent;
			border-left: solid 10rpx #fff;
			border-bottom: solid 10rpx transparent;
			z-index: 9;
		}
	}

	// 快捷功能入口
	.fu-month-in {
		position: relative;
		z-index: 2;

		.fu-in-item {
			display: flex;
			flex-direction: column;
			align-items: center;
			justify-content: space-around;
			margin: 24rpx 0;
		}
	}

	// 我的订单
	.my-order {
		image {
			width: 56rpx;
			height: 56rpx;
		}

		.item {
			position: relative;

			.jiaobiao {
				position: absolute;
				top: -20rpx;
				right: 30rpx;
				color: #FFFFFF;
				font-size: 24rpx;
				// border: 1rpx solid $theme;
				border-radius: 100rpx;
				width: 40rpx;
				height: 40rpx;
				line-height: 38rpx;
				text-align: center;
				background-color: #FF6464;
				z-index: 9;
				transform: scale(0.65);
			}
		}
	}

	.member-box {
		height: 112rpx;
		background-image: url($IMG_BASE_URL + 'tab/member-bg.png');
		background-size: 100% 100%;
		position: relative;
		// top: 30rpx;
		// margin-top: 40rpx;
		padding: 24rpx 40rpx;

		.up-bt {
			width: 160rpx;
			height: 64rpx;
			background: linear-gradient(180deg, #EBBDA9 0%, #BE7C38 100%);
			line-height: 64rpx;
			text-align: center;
			color: #ffffff;
			font-size: 24rpx;
			opacity: 1;
			border-radius: 32rpx;
		}

		.money-box {
			display: flex;
			justify-content: space-between;
			align-items: center;

			image {
				width: 40rpx;
				height: 40rpx;
			}

			.money-text {
				color: #AA6810;
				font-size: 28rpx;
				// font-weight: bold;
				margin-left: 30rpx;
			}
		}
	}

	// 复制标签
	.fu-copy-invite {
		display: inline-block;
		width: 72rpx;
		height: 36rpx;
		text-align: center;
		line-height: 36rpx;
		border-radius: 6rpx;
		background-color: #FFD6AD;
		color: $theme;
	}

	.my-img-box {
		height: 162rpx;
		margin-top: 20rpx;

		image {
			width: 100%;
			height: 100%;
		}
	}

	.msg-box {
		position: relative;
		// margin-left: 40rpx;

		// 	.msg-icon {
		// 		width: 64rpx;
		// 		height: 64rpx;
		// 		min-width: 64rpx;
		// 	}

		.msg-tip {
			background-color: #FD433C;
			color: #ffffff;
			width: 32rpx;
			height: 32rpx;
			font-size: 20rpx;
			// padding: 2rpx 4rpx;
			border-radius: 50%;
			text-align: center;
			line-height: 32rpx;
			position: absolute;
			right: -10rpx;
			top: 0;
		}
	}

	.qiandao {
		width: 160rpx;
		height: 72rpx;
		background-color: #fff;
		box-shadow: 0rpx 3rpx 10rpx 1rpx rgba(0, 0, 0, 0.12);
		border-radius: 36rpx 36rpx 36rpx 36rpx;

		.icon {
			width: 30rpx;
			height: 28rpx;
		}
	}

	.cu-btn {
		background: transparent;
		padding: 0;
	}

	.tag {
		background: #FF6464;
		font-size: 20rpx;
		color: #fff;
		border-radius: 50%;
		width: 30rpx;
		height: 30rpx;
		line-height: 30rpx;
		text-align: center;
	}

	.box1 {
		height: 100rpx;
		width: 334rpx;
		// border-radius: 16rpx;
		// background: linear-gradient(160deg, #ffaf93 20% , #ffffff 100%);
		// text-align: center;
		background: url(https://localelife.chunchuangkeji.cn/h5img/tab/group_02.png) no-repeat center / cover;
		box-sizing: border-box;

		&.bg-2 {
			background: url(https://localelife.chunchuangkeji.cn/h5img/tab/group_01.png) no-repeat center / cover;
		}

		.left {
			width: 128rpx;
		}
	}

	.box2 {
		background-color: #fff;
		border-radius: 16rpx;
		box-shadow: 0rpx 0rpx 5rpx 2rpx #eee;
		padding: 32rpx 24rpx;
		max-height: 400rpx;
	}

	.padding-b-16 {
		padding-bottom: 16rpx;
	}

	.itemBox {
		display: flex;
		margin-top: 24rpx;
	}

	.mewBox {
		width: 700rpx;
		height: 160rpx;
		margin: 24rpx auto;
		padding: 26rpx 32rpx;
		background: #fff;
		background: url(../../../../static/menbg.png) no-repeat;
		background-size: 100% 100%;
	}
</style>